/*
 this is car class
 */

#import<Foundation/Foundation.h>

@interface Car : NSObject
{
    @public
    int wheels;
    float speed;
}

-(int)SetNum: (int) nA :(int) nB :(int) nC; //nA,nB为传入参数
@end

@implementation Car
- (id)init
{
    if(self = [super init])
    {
        wheels = 4;
        speed = 250;
    }
    
    return (self);
}

-(int)SetNum: (int) nA :(int) nB :(int) nC
{
    if(nA>0)
    {
        wheels = nA;
    }
    if(nB>0)
    {
        self->speed = nB;
    }
    
    NSLog(@"%d个轮子，速度为%f的车子跑起来了" , wheels , speed);
    return (nA + nB + nC);
}

@end

int main(int argc, const char * argv[])
{
     @autoreleasepool {
         //Car * pCar = [[Car alloc] init ];
         Car * pCar = [Car new];
         //int sum = [pCar SetNum:3:222:88];
         
         //NSLog(@"hello world %d" , sum);
     }
    return 0;
}